package util;

import java.util.Vector;

public final class StringTokenizer {
	private String str;
	private String token;

	public StringTokenizer(String str, String token) {
		this.str = str;
		this.token = token;
	}

	public Vector getTokens() {
		Vector tokens = new Vector();

		boolean foundToken = true;

		while (foundToken) {
			if (str.indexOf(token) > -1) {
				tokens.addElement(str.substring(0, str.indexOf(token)));
				str = str.substring(str.indexOf(token) + token.length());
				foundToken = true;
			} else {
				tokens.addElement(str);
				foundToken = false;
			}
		}

		return (tokens);
	}
}
